/**
 * In me the tiger sniffs the rose.
 *
 * @Author:徐家政
 * @Date:2019-04-15 22:38
 */
package com.shiyu.demo.controller;

import com.shiyu.demo.entity.CommunityImg;
import com.shiyu.demo.service.CommunityImgService;
import com.shiyu.demo.util.R;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@CrossOrigin
public class HeadImgController {
    @Resource
    private CommunityImgService communityImgService;
    @RequestMapping("/community/topimg")
    public R getheadImg(){
        List<CommunityImg>imgList =communityImgService.getHeadImg();
        if (imgList!=null&&imgList.size()!=0){
            return R.ok().put("imgList",imgList);
        }
        return R.error("图片开小差了,请稍后再试");
    }
}
